package com.atcumt.alibaba;

import java.util.Arrays;
import java.util.Scanner;

public class Main01 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        int count = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                int[] temp = solve(nums, i, j + 1);
                if (Arrays.stream(temp).max().getAsInt() / Arrays.stream(temp).min().getAsInt() == k) {
                    count++;
                }
            }
        }
        System.out.println(count);
        in.close();
    }

    private static int[] solve(int[] arr, int i, int j) {
        int[] res = new int[j - i];
        for (int k = 0; k < j - i; k++) {
            res[k] = arr[i + k];
        }
        return res;
    }
}
